<?python
   from mnemoply import model
?>
<span xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/">

    <?python
         fields = [
             'agreementID',
             'healthProblems',
             'studentID',
             'avgMark',
             'groupFromID',
             'initialPlanMethodologistWishID',
             'planID',
             'comment',
             'possibleDayID',
             'officeID',
             'initialPlanTeacherWishID',
             'year',
             'teacherID',
             'behaviourComment',
             'groupCacheTitle',
             'friends',
             'opponents',
         ]
    ?>

    <span py:def="display_fields(field_list)">
        <table border="0" cellspacing="0" cellpadding="2">
            <tr py:for="field in field_list">
                <?python
                     name = field
                     value, column = m_values[name]
                     title = column.title
                     ?>
                <th>
                    <label class="fieldlabel" for="${name}" py:content="title" />
                </th>
                <td>${value} </td>
            </tr>
        </table>
    </span>

    <div style="height: 650px; overflow-y: scroll;">
        <ul>
            <li py:strip="True" py:for="m in model.StudentMigration.selectBy(student=obj)">
                <center>${m.title}</center>
                <?python m_values = controller.obj2item_view(m) ?>
                ${display_fields(fields)}
                <br />
            </li>
        </ul>
    </div>
</span>

